//
//  NSString+cc_md5.m
//  ocCrazy
//
//  Created by mac on 2018/5/9.
//  Copyright © 2018年 dukai. All rights reserved.
//

#import "NSString+cc_md5.h"

#import <CommonCrypto/CommonDigest.h>

#import "PinYin4Objc.h"

@implementation NSString (cc_md5)

- (NSString *)htmlStrWithColor:(NSString *)color withFont:(NSString *)font{
    
   NSString  * cc_change = @"<font ";
   if (color && color.length != 0) {
      cc_change = [cc_change stringByAppendingFormat:@"color = '%@' ",color];
       if (!font || font.length == 0) {
           cc_change = [cc_change stringByAppendingString:@">"];
       }
   }
   if (font && font.length != 0) {
      cc_change = [cc_change stringByAppendingFormat:@"size = '%@pt'>",font];
   }
    cc_change = [cc_change stringByAppendingFormat:@"%@</font>",self];
    return cc_change;
}

-(NSString *)pinYin{
    NSString *str = nil;

    NSString *first = [str substringToIndex:1];
    if ([first isEqualToString:@"长"] || [first isEqualToString:@"重"]) {
        return @"C";
    }
    NSString *pinyin = [PinyinHelper pinyin:self];
    NSString *nStr = [[pinyin substringToIndex:1] uppercaseString];
    return nStr;
}

@end
